﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WenSkin.Controls
{
    public class WenContextMenuStrip : ContextMenuStrip
    {
        public WenContextMenuStrip()
        {
            this.Renderer = new ToolStripRenderer();
            this.BackColor = Color.FromArgb(37, 37, 38);
        }
        //画背景 默认不允许为透明
        protected override void OnPaintBackground(PaintEventArgs e)
        {
            Graphics g = e.Graphics.SetGDIHigh();
            g.SetClip(new Rectangle(0, 0, Width, Height));
            g.FillRectangle(new SolidBrush(this.BackColor), -1, -1, this.Width + 1, this.Height + 1);
        }
        [DefaultValue(ToolStripRenderMode.Custom)]
        public new ToolStripRenderMode RenderMode { get => base.RenderMode; set { this.Renderer = new ToolStripRenderer(); } }
    }
}
